Move is_html (and a fwe in-methods that I could find) from int to bool.
authorRobert Lipe <robertlipe@gpsbabel.org>
Mon, 27 Nov 2017 05:47:25 +0000 (23:47 -0600)
committerRobert Lipe <robertlipe@gpsbabel.org>
Mon, 27 Nov 2017 05:47:25 +0000 (23:47 -0600)
15 files changed:
bushnell_trl.cc
garmin_gpi.cc
googledir.cc
gpx.cc
igc.cc
itracku.cc
main.cc
mmo.cc
mtk_logger.cc
osm.cc
queue.cc
teletype.cc
tpo.cc
util.cc
v900.cc

index cb32441af40907e7fc97c63785d0be72b6634e13..59a38e7606acc65964be4be41f51781dbd5af907 100644 (file)
@@ -98,7 +98,7 @@ bushnell_read()
 {
   int lat_tmp,lon_tmp;
 
-  while (1) {
+  while (true) {
     Waypoint* wpt_tmp;
 
     lat_tmp = gbfgetint32(file_in);
index 7d7db040b0dc6fe328e2552feeea6742917a01a7..8c96c7a73044899d034d88fefcace7f7f037d517 100644 (file)
@@ -1562,7 +1562,7 @@ garmin_gpi_wr_deinit()
 static void
 garmin_gpi_read()
 {
-  while (1) {
+  while (true) {
     int tag = gbfgetint32(fin);
     if (tag == 0xffff) {
       return;
index e96f7cacf3cad346f5d537a5895d4f7fb384d429..c477802de2e37b469ddc247047976f38a2bdc510 100644 (file)
@@ -104,7 +104,7 @@ goog_poly_e(xg_string args, const QXmlStreamAttributes*)
       routehead->rte_desc = QString("Step %1").arg(goog_step);
     } else {
       utf_string utf;
-      utf.is_html = 1;
+      utf.is_html = true;
       utf.utfstring = instructions;
       char *s = strip_html(&utf);
       routehead->rte_desc = s;
diff --git a/gpx.cc b/gpx.cc
index 62500ec98af7ce0db0d605c43bb68b448b9ce335..b067915c20f8a8dac018420886ffb22a08e32076 100644 (file)
--- a/gpx.cc
+++ b/gpx.cc
@@ -56,7 +56,7 @@ static QString current_tag;
 
 static Waypoint* wpt_tmp;
 static UrlLink* link_;
-static int cache_descr_is_html;
+static bool cache_descr_is_html;
 static gpsbabel::File* iqfile;
 static gpsbabel::File* oqfile;
 static gpsbabel::XmlStreamWriter* writer;
@@ -494,10 +494,10 @@ tag_wpt(const QXmlStreamAttributes& attr)
 static void
 tag_cache_desc(const QXmlStreamAttributes& attr)
 {
-  cache_descr_is_html = 0;
+  cache_descr_is_html = false;
   if (attr.hasAttribute("html")) {
     if (attr.value("html").toString() == QStringLiteral("True")) {
-      cache_descr_is_html = 1;
+      cache_descr_is_html = true;
     }
   }
 }
diff --git a/igc.cc b/igc.cc
index 7cf6fc78722b8ad131b3ed6e66086a8de48468dc..eb30dbde0a79861ca4de93e7d4441b78be06a3ab 100644 (file)
--- a/igc.cc
+++ b/igc.cc
@@ -281,7 +281,7 @@ static void data_read()
 
   strcpy(trk_desc, HDRMAGIC HDRDELIM);
 
-  while (1) {
+  while (true) {
     rec_type = get_record(&ibuf);
     switch (rec_type) {
     case rec_manuf_id:
index e4ff18498ccb96558f70bc875cd3b1a6deedfec7..ec6769c2bd2a5e13b2b7f0f1f04ffd2ce635817b 100644 (file)
@@ -747,7 +747,7 @@ itracku_rt_position(posn_status*)
 {
   char line[1024];
   Waypoint* wpt;
-  while (1) {
+  while (true) {
     gbser_read_line(fd, line, sizeof(line), 5000, 13, 10);
     dbg(1, line);
     wpt = gprmc_parse(line);
diff --git a/main.cc b/main.cc
index f57fb0ea2760a3ea53886b4097c64b20b533960b..0f51286b4301fc14f3f833b0281c38c7e030242d 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -33,7 +33,7 @@
 #include <clocale>
 #include <cstdio>
 #include <cstdlib>
-#include <signal.h>
+#include <csignal>
 
 #define MYNAME "main"
 
@@ -228,7 +228,7 @@ main(int argc, char* argv[])
   char* ofname = NULL;
   const char* ivec_opts = NULL;
   const char* ovec_opts = NULL;
-  char* fvec_opts = NULL;
+  const char* fvec_opts = NULL;
   int opt_version = 0;
   int did_something = 0;
   const char* prog_name = argv[0]; /* argv is modified during processing */
diff --git a/mmo.cc b/mmo.cc
index 542b83c65592cb4b4cd796b247dbb8ef4465521e..9b3ae4f9cfd44f715e835f2b6e6715a76f745bdd 100644 (file)
--- a/mmo.cc
+++ b/mmo.cc
@@ -1294,7 +1294,7 @@ mmo_write_wpt_cb(const Waypoint* wpt)
       utf_string tmp;
 
       tmp.utfstring = cx;
-      tmp.is_html = 1;
+      tmp.is_html = true;
       cx = kml = strip_html(&tmp);
     }
     str += cx;
index 15ea67ba610dbcca0abb77aa63a7a23b1caea0e9..d4b3d4abd0f1cca7731c0c1b0ba0824095fd60c8 100644 (file)
@@ -588,7 +588,7 @@ static void mtk_read()
   }
 
   gb_sleep(10*1000);
-  if (1 || log_enabled) {
+  if (true || log_enabled) {
     i = do_cmd(CMD_LOG_DISABLE, "PMTK001,182,5,3", NULL, 2);
     dbg(3, " ---- LOG DISABLE ---- %s\n", i==0?"Success":"Fail");
   }
diff --git a/osm.cc b/osm.cc
index 25775a2c31e7a362ee9086ab1a48cb8d7d09f0fe..3caf66ec5436c86a97138313ca9130e4837c0e0d 100644 (file)
--- a/osm.cc
+++ b/osm.cc
@@ -460,7 +460,7 @@ static char*
 osm_strip_html(const char* str)
 {
   utf_string utf;
-  utf.is_html = 1;
+  utf.is_html = true;
   utf.utfstring = (char*)str;
 
   return strip_html(&utf);     // util.cc
index bba69cd14bd57372cd897bf78c5452869258630d..e5f40494e84bcdf6d6dcc318e63ca4d3cb143cd1 100644 (file)
--- a/queue.cc
+++ b/queue.cc
@@ -113,7 +113,7 @@ sortqueue(queue* qh, int (*cmp)(const queue*, const queue*))
 
   insize = 1;
 
-  while (1) {
+  while (true) {
     p = list;
     oldhead = list;     /* only used for circular linkage */
     list = NULL;
index c9db7dc6970135ae46ebbf43310220d275364132..f789981ed0ff6faf6a0d36a2f3056dc4450dd5e6 100644 (file)
@@ -63,14 +63,14 @@ teletype_read()
     wpt->shortname = (gbfgetcstr(fin));
     wpt->description = (gbfgetcstr(fin));
 
-    if (1) { // needs bit values of NEWFORMAT2
+    if (true) { // needs bit values of NEWFORMAT2
       uint32_t direction = gbfgetuint32(fin);
       uint32_t mins = gbfgetuint32(fin);
       (void) direction ;
       (void) mins ;
     }
 
-    if (1) {  // need bit value of NEWFORMAT
+    if (true) {  // need bit value of NEWFORMAT
       int len = gbfgetuint16(fin);
       // probably could treat as a pascal string
       char* junk = (char*) xmalloc(len);
diff --git a/tpo.cc b/tpo.cc
index 83edc77d1dda64cc9728c0826b5298af98a83557..d8dbddc661daf988000a6deb904290db9fe1aadc 100644 (file)
--- a/tpo.cc
+++ b/tpo.cc
@@ -215,7 +215,7 @@ tpo_read_until_section(const char* section_name, int seek_bytes)
   unsigned int match_index = 0;
   int header_size = 0;
 
-  while (1) {
+  while (true) {
     if (gbfread(&byte, 1, 1, tpo_file_in) < 1) {
       fatal(MYNAME ": malformed input file - attempt to read past end");
     }
diff --git a/util.cc b/util.cc
index 67a300ae0fdbb480c78539f819c853110e4a0172..fd96cdf47363b2c7fd8275127abfa5543a3f91b3 100644 (file)
--- a/util.cc
+++ b/util.cc
@@ -1613,7 +1613,7 @@ entity_types stdentities[] =  {
 
 static
 char*
-entitize(const char* str, int is_html)
+entitize(const char* str, bool is_html)
 {
   int elen, ecount, nsecount;
   entity_types* ep;
diff --git a/v900.cc b/v900.cc
index b66338cb0da1df1fc39c6f2a791cbf7bea000157..1cecd9c1714ec3f9ecdf0c5098fba17dc71a53d9 100644 (file)
--- a/v900.cc
+++ b/v900.cc
@@ -236,7 +236,7 @@ v900_read()
   track->rte_desc = "V900 GPS tracklog data";
   track_add_head(track);
 
-  while (1) {
+  while (true) {
     Waypoint* wpt;
     char c;
     int bad = 0;